package com.wuyou.designPatterns.command;

import java.awt.*;

/**
 * 表示"绘制一个点命令"
 *
 * @Date 2024/10/18 16:01
 * @Author 无忧
 */
public class DrawCommand implements Command{

    // 绘制对象
    protected Drawable drawable;
    // 绘制位置
    private Point position;

    public DrawCommand(Drawable drawable, Point position){
        this.drawable = drawable;
        this.position = position;
    }

    @Override
    public void execute() {
        drawable.draw(position.x, position.y);
    }
}
